package com.xingchi.tornado.test.controller;

import com.xingchi.tornado.basic.Result;
import com.xingchi.tornado.test.model.dto.UserDTO;
import com.xingchi.tornado.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户表 前端控制器
 *
 * @author xingchi
 * @date 2025-03-10 14:08
 */
@RestController
@RequestMapping("/test/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/add")
    public Result<Long> createUser(@RequestBody UserDTO userDTO) {
        return Result.ok(userService.create(userDTO));
    }

}
